package com.yy.jhl.ui.manager.presenter;

import com.google.gson.Gson;
import com.yy.jhl.api.Api;
import com.yy.jhl.api.RxSubscriber;
import com.yy.jhl.app.AppConstant;
import com.yy.jhl.bean.BatchListInfo;
import com.yy.jhl.bean.FreightForwardInfo;
import com.yy.jhl.ui.manager.contract.FreightForwardContract;
import com.yy.jhl.ui.manager.contract.FreightForwardContract.Presenter;

import java.util.HashMap;
import java.util.Map;

import okhttp3.FormBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;

/**
 * Created by libingn on 2017/12/21.
 */

public class FreightForwardPresenter extends Presenter {
    @Override
    public void getList(String batch_id,String address_id,boolean isDialog) {
        mRxManage.addSubscription(Api.getDefault().getContractsInfo(batch_id,address_id), new RxSubscriber<ResponseBody>(mContext,isDialog) {
            @Override
            protected void _onNext(String result) {
                FreightForwardInfo info = new Gson().fromJson(result,FreightForwardInfo.class);
                mView.getListSuccess(info);
            }

            @Override
            protected void _onError(String message) {
                mView.getListFail();
            }
        });
    }
}
